package com.slicktechnologies.client.config.categoryconfig;

import com.slicktechnologies.client.utility.Screen;
import com.slicktechnologies.shared.common.helperlayer.ConfigCategory;


/**
 * Provides a way for differentiating between differnt types of {@link ConfigCategory} and Type.
 * @author Kamala
 *
 */
public enum CategoryTypes{
	//Token to add the configTypes with integer value
    /** The customercategory. */
	CUSTOMERCATEGORY(1),
/** The leadcategory. */
LEADCATEGORY(2),
/** The quotationcategory. */
QUOTATIONCATEGORY(3),
/** The contractcategory. */
CONTRACTCATEGORY(4),
/** The vendorcategory. */
VENDORCATEGORY(5),
/** The complaincategory. */
COMPLAINCATEGORY(6),
    
    /** The expensecategory. */
    EXPENSECATEGORY(7);
    
    /** The value. */
    private final int value;

    /**
     * Instantiates a new category types.
     *
     * @param newValue the new value
     */
    private CategoryTypes(final int newValue) {
        value = newValue;
    }

    /**
     * Returns int value of the configtype .
     *
     * @return value
     */
    public int getValue() 
    { 
    	return value; 
    }
    
    /**
     *  Returns the integer value corresponding to configType Screen.
     *
     * @param screen the screen
     * @return the category internal type
     */
    public static int getCategoryInternalType(Screen screen) {
    	System.out.println("Value of Screen is "+screen);
    	switch(screen)
    	{
    	
    	   
    	 
    	 
    	 
    	  case EXPENSECATEGORY:
    		  return EXPENSECATEGORY.getValue();
 /////////////For Type Screens///////////////////////////////////////////////////////////////////////////////////
    	 
    	  case EXPENSETYPE:
    		  return EXPENSECATEGORY.getValue();
    	  
    		    
	     default:
			break;
    			
    		
    	}
     	
      return -1;
    }
    
    
    /**
     * Gets the category internal type on form screen.
     *
     * @param screen the screen
     * @return the category internal type on form screen
     */
    public static int getCategoryInternalTypeOnFormScreen(Screen screen) {
    	
    	switch(screen)
    	{
    	  case CUSTOMER:
    		  return CUSTOMERCATEGORY.getValue();
    	  case CONTRACT:
	             return CONTRACTCATEGORY.getValue();
    	 
    	  case EXPENSEMANAGMENT:
    		  return EXPENSECATEGORY.getValue();
    	
    	  
    		    
	     default:
			break;
    			
    		
    	}
     	
      return -1;
    }

}